package org.mihalovic.PES.data;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Set;
import java.util.List;

import org.mihalovic.PES.Core.Graph.Node;
import org.mihalovic.PES.Core.Graph.Edge;



/**
 * @author Martin Mihalovic
 */
public interface SourceGraphReader
{
    /**
     * Indicates whether the used resource (file, database...) is still available
     * 
     * @return true if source is ready to be asked for data
     */
    boolean isOpen();

    Set<Node> GetNodesInvolvedWithDomains(String[] domainIDs) throws SourceGraphReaderException;
    List<Edge> GetRatingsInDomains(String[] domains) throws SourceGraphReaderException;
    Collection<Domain> GetDomainsWithRatingCounts()throws SourceGraphReaderException;
    ArrayList<Domain> GetDomains() throws SourceGraphReaderException;

    int GetNodesCount() throws SourceGraphReaderException;
    int getDomainsCount() throws SourceGraphReaderException;

    /**
     * Close resource used to load graph data
     * @throws Soner.data.SourceGraphReaderException
     */
    void CloseReader() throws SourceGraphReaderException;
}
